#include<sys/types.h>
#include<unistd.h>
#include<stdio.h>
#include<string.h>

int main()
{
	printf("uid: %u\n",getuid());
	printf("euid %u\n",geteuid());
	if (setuid(1000) < 0)
	{
		perror("setuid error");
	}
	printf("uid: %u\n",getuid());
	printf("euid %u\n",geteuid());
	/*
	 *  sudo chown root:root process_id.out
	 *  sudo chmod u+s process_id.out
	 *  ./process_id.out 
	 *  uid: 1000
	 *  euid 0
	 *  uid: 1000
	 *  euid 1000
	 * */
	return 0;
}
